package com.kashow.base.adapter;

import android.view.ViewGroup;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zhy.autolayout.utils.AutoUtils;

import java.util.ArrayList;
import java.util.List;


public abstract class QuickAdapter<T> extends BaseQuickAdapter<T,BaseViewHolder> {
    public QuickAdapter(int layoutResId, List<T> data) {
        super(layoutResId, data);
    }

    @Override
    public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        BaseViewHolder viewHolder =  super.onCreateViewHolder(parent, viewType);
        AutoUtils.autoSize(viewHolder.itemView);
        return viewHolder;
    }

    public void setData(List<T> mData) {
        this.mData =  mData == null ? new ArrayList(): mData;
    }
}
